<?php
/*Problem Domain
To Test the Technology class access object
*/
include_once '../TechnologyDAOImpl.php';
include_once '../../model/Technology.php';

class TestTechnologyDAOImpl extends PHPUnit_Framework_TestCase
{
	public function testTechnologyDAOImplObject()
	{
		$dbobj = new TechnologyDAOImpl();
		$conn = $dbobj->getConnection();
		$tech1 = new Technology("PHP", "server side scripting language"); 

		$dbobj->saveOrUpdate($tech1);

		$arr = $dbobj->listTechnology();
		$lst = $arr->getArrayList();
		$this->assertEquals('PHP', $lst[0]->getTechName());

		$tech1->setTechName('webui');
		$dbobj->saveOrUpdate($tech1);
		$dbobj = new TechnologyDAOImpl();
		$arr = $dbobj->listTechnology();
		$lst = $arr->getArrayList();
		$this->assertEquals('webui', $lst[0]->getTechName());

	}
}
?>
